/*
 * Created on 09-sep-2004
 */
package gurulab.merlin.core.envelope;

import java.util.Properties;

import gurulab.merlin.core.CantHandException;
import gurulab.merlin.server.EPContainer;

/**
 *
 * @author Cesar Obach-Renner, cesar AT gurulab.org
 * @version 2.0
 */
public abstract class AbstractEnvelopeProcessor implements EnvelopeProcessor {
    EnvelopeHandler handler;
    protected EPContainer container;
    private boolean busy;
    protected Properties properties = new Properties();
    
    public AbstractEnvelopeProcessor(EPContainer container,Properties props){
    	this.container = container;
    	this.properties = props;
    }
    /**
     * 
     * @param parametersFilePath
     * @throws gurulab.merlin.core.CantHandException
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#openConnection(java.lang.String)
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public void openConnection(String parametersFilePath) throws CantHandException {

    }

    /**
     * @throws gurulab.merlin.core.CantHandException
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#closeConnection()
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public void closeConnection() throws CantHandException {

    }

    /**
     * 
     * @param h
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#addEnvelopeHandler(gurulab.merlin.core.envelope.EnvelopeHandler)
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public void addEnvelopeHandler(EnvelopeHandler h) {
        handler = h;
    }

    /**
     * 
     * @return gurulab.merlin.core.EnvelopeHandler
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#getEnvelopeHandler()
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public EnvelopeHandler getEnvelopeHandler() {
        return handler;
    }

    /**
     * 
     * @throws gurulab.merlin.core.CantHandException
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#start()
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public void start() throws CantHandException{
    }

    /**
     * 
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#stop()
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public void stop() {
    }

    /**
     * 
     * @return gurulab.merlin.core.EnvelopeHandler
     * @see gurulab.merlin.core.envelope.EnvelopeProcessor#areYouAlive()
     * @author Cesar Obach-Renner, cesar AT gurulab.org
     */
    public boolean areYouAlive() {
        return true;
    }
    
    
    /**
     * 
     */
    public boolean isBusy() {
    	return busy;
    }
    
    /**
     * 
     */
    public void setBusy(boolean busy) {
    	this.busy = busy;
    }
    
    public Properties getProperties() {
    	return properties;
    }
    
    public void setProperties(Properties props) {
    	this.properties = props;    	
    }
}
